<#include "/common/layout.html">
<@header>
</@header>
<@body>
<div class="right_col" role="main">
	<div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
          	<div class="x_panel">
	            <div class="x_title">
	              <h2>修改密码</h2>
	              <div class="clearfix"></div>
	            </div>
	            <div class="x_content">
	              	<form id="pwdForm" method="post" action="${ctx}/system/me/doChangePwd" class="form-horizontal form-label-left">
		                <div class="form-group">
		                  <label class="control-label col-md-2 col-sm-2 col-xs-12">
	                		旧的密码 <span class="required">*</span>
		                  </label>
		                  <div class="col-md-8 col-sm-8 col-xs-12">
		                    <input type="password" id="password" name="password" required class="form-control">
		                  </div>
		                </div>
		                <div class="form-group">
		                  <label class="control-label col-md-2 col-sm-2 col-xs-12" for="newpassword">
		                  	新的密码 <span class="required">*</span>
		                  </label>
		                  <div class="col-md-8 col-sm-8 col-xs-12">
		                    <input type="password" id="newpassword" name="newpassword" required class="form-control">
		                  </div>
		                </div>
		                <div class="form-group">
		                  <label class="control-label col-md-2 col-sm-2 col-xs-12" for="newpassword2">
		                  	重复密码 <span class="required">*</span>
		                  </label>
		                  <div class="col-md-8 col-sm-8 col-xs-12">
	                   		<input type="password" id="newpassword2" name="newpassword2" required class="form-control">
		                  </div>
		                </div>
	                	<div class="ln_solid"></div>
		                <div class="form-group">
		                  <div class="col-md-8 col-sm-8 col-xs-12 col-md-offset-2">
		                    <button type="button" class="btn btn-info" onclick="submitHandler()">提交</button>
												<button class="btn btn-danger" type="reset">重置</button>
		                  </div>
		                </div>
	              	</form>
	            </div>
          	</div>
        </div>
	</div>
</div>
</@body>
<@footer>
<script type="text/javascript">
	function submitHandler() {
		if ($("#pwdForm").validate().form()) {
			var formData = $("#pwdForm").serialize();
			$.ajax({
				url : $("#pwdForm").attr('action'),
				type : 'POST',
				dataType: "json",
				data : formData,
				success : function(data) {
					if (data.code == 200) {
						if (data.msg) {
							parent.layer.msg(data.msg, {
								icon : 1
							});
						} else {
							parent.layer.msg('提交成功', {
								icon : 1
							});
						}
						window.parent.location.reload();
					} else {
						layer.msg(data.msg, { icon : 2 });
					}
				}
			});
		}
	}
</script>
</@footer>
